package com.trkj.property_controller;

import com.trkj.entity.CarParkEntity;
import com.trkj.entity.ParkingEntity;
import com.trkj.service.CarParkService;
import com.trkj.vo.AjaxResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@Slf4j
@CrossOrigin
public class CarParkController {
    @Resource
    private CarParkService carParkService;
    //查询车场车位
    @PostMapping("/CarParkList")
    public AjaxResponse CarParkList(CarParkEntity carParkEntity){
        return AjaxResponse.success(carParkService.CarParkList(carParkEntity));
    }
    //根据房屋id查车位的信息
    @PostMapping("/CarParkXinxi/{id}")
    public AjaxResponse CarParkXinxi(@PathVariable("id") int id){
        return AjaxResponse.success(carParkService.CarParkXinxi(id));
    }
    //查询所有停车位数量
    @PostMapping("/ParkList")
    public AjaxResponse ParkList(){
        return AjaxResponse.success(carParkService.ParkList());
    }
}
